package itheima.d08;

import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年纪：");



        String ageStr = sc.next();
        if (!ageStr.matches("\\d+")) {
            System.out.println("请输入正确的年纪！");
            return;
        }


        int age = Integer.parseInt(ageStr);


        age = age + 1;


        System.out.println("增加1岁后的年龄为: " + age);


    }
}
